You are here: BlueCieloECM.GcfSupport class > CallRemote function

CallRemote function

Makes a remote call to the specified vault.

Syntax

Function CallRemote (ShareName, DocGlobalID, FunctionName, _
                     FunctionArguments, TimeOut)
Parameters
Name Description

ShareName

The share name of the vault (as shown in the GCF Configuration page) to be called.

DocGlobalID

The Global ID of a document in the local vault for which the corresponding document with a matching Global ID in the remote vault will be set as the Document object in the remote VBScript function.

FunctionName

The name of the VBScript function to be executed in the remote vault.

FunctionArguments

The parameters to supply to the remote function. A parameter may also be a variant array.

TimeOut

Not used; the timeout always defaults to 20 seconds.

Return value

When successful, returns the result of the remote function. This may be a variant, including a variant array. When an error occurred, returns the string CallRemote: followed by the error message. When a timeout occurred, returns Null.

Remarks

All remote calls are performed using the account specified in the configuration of the share as described in Creating and editing a share and therefore require basic authentication. If the existing site must use Windows authentication only, see Creating a GCF website with basic authentication.

Example

Assume the following VBScript function is defined at the remote vault:

Function RemoteFunction (Argument1, Argument2)
    Dim vResult (4)
    
    vResult (0) = "Argument 1 = " & Argument1
    vResult (1) = "Argument 2 = " & Argument2
    vResult (3) = "Local Vault = " & Vault.Name 
    vResult (4) = "Current document = " & Document.Filename 
    
    RemoteFunction = vResult
End Function

The function can be called remotely by using the following VBScript:

Dim objGCFSupport
Set objGCFSupport = CreateObject("BlueCieloECM.GcfSupport")
Dim vArgs (2)
vArgs (0) = "Argument 1"
vArgs (1) = "Argument 2"
vReturn = objGCFSupport.CallRemote("OtherShare", Document.GlobalID, _ "RemoteFunction", vArgs)

Set objGCFSupport = Nothing
If IsArray (vReturn) Then
    s = ""
    For i = LBound (vReturn) To UBound (vReturn)
        s = s & vReturn (i) & vbCrLf
    Next
    WinMsgBox s
End If

Related information

UpdateTable function

Creating a GCF website with basic authentication